﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.Net;

namespace zj.Common
{
    //正则表达式验证类
    public class DataValidate
    {
        public static  bool IsIPAddress(string ipAddress)
        {
            return Regex.IsMatch(ipAddress, @"^((2(5[0 - 5] |[0 - 4]\\d)) |[0 - 1] ?\\d{ 1,2})(\\.((2(5[0 - 5] |[0 - 4]\\d)) |[0 - 1] ?\\d{ 1,2})){ 3}$");
        }
        public static bool IsPort(string port)
        {
            return Regex.IsMatch(port, @"^((6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])|[0-5]?\d{0,4})$");

        }
    }
}
